# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-parsel
_pkgname=parsel
pkgver=1.5.2
pkgrel=1
pkgdesc='A library to extract data from HTML and XML using XPath and CSS selectors.'
arch=('any')
license=('BSD')
url='https://github.com/scrapy/parsel'
depends=('python2-cssselect' 'python2-lxml' 'python2-six' 'python2-w3lib'
         'python2-functools32')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f7b8a0b2d522e90e69b389c881175ae8478a6dc49eb03432b68707fbea54987b176a45565ff6787958b66f299d0d82c5862c199f8b7721f311b783b71a04a4e6')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

